import 'package:flutter/material.dart';

import '../../../common/my_icon.dart';
import '../../../components/dialog/exit_dialog.dart';
import '../../../utils/screenutil/fit.dart';

class Head extends StatelessWidget {
  String name;

  Head({String name = '匿名'}) : this.name = name;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 580.f,
      height: 120.f,
      margin: EdgeInsets.only(left: 30.f),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            "您好，${name == '匿名' ? '$name的管理员' : name}",
            style: TextStyle(
              color: Colors.white,
              fontSize: 28.f,
            ),
          ),
          InkWell(
            onTap: () => ExitDialog.exit(context),
            child: Icon(
              MyIcon.exit,
              size: 20,
              color: Colors.white,
            ),
          ),
        ],
      ),
    );
  }
}
